/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package tofc.chart;

import tofc.value.BaseCol;
import java.util.ArrayList;
import java.util.List;

/**
 * BaseBarChart:
 * @author p476733
 */
public class BaseBar extends BaseXYChart {

    private List values;
    private String colour;
    private Number alpha;
    private String tip;
    private String type;

    /**
     *
     */
    public BaseBar() {
        this.values = new ArrayList();
    }

    /**
     *
     * @return type
     */
    public String getType() {
        return type;
    }

    /**
     *
     * @param type
     */
    public void setType(String type) {
        this.type = type;
    }

    /**
     *
     * @return alpha the alpha of the bar.
     */
    public Number getAlpha() {
        return alpha;
    }

    /**
     *
     * @param alpha
     */
    public void setAlpha(Number alpha) {
        this.alpha = alpha;
    }

    /**
     *
     * @return colour the colour of the bar.
     */
    public String getColour() {
        return colour;
    }

    /**
     *
     * @param colour
     */
    public void setColour(String colour) {
        this.colour = colour;
    }

    /**
     *
     * @return tip
     */
    public String getTip() {
        return tip;
    }

    /**
     *
     * @param tip
     */
    public void setTip(String tip) {
        this.tip = tip;
    }

    /**
     *
     * @return values
     */
    public List getValues() {
        return values;
    }

    /**
     *
     * @param values
     */
    public void setValues(Number... values) {
        this.values.clear();
        addValues(values);
    }

    /**
     *
     * @param cols
     */
    public void setValues(BaseCol... cols) {
        this.values.clear();
        addValues(cols);
    }

    /**
     *
     * @param position
     * @param value
     */
    public void setValue(int position, Number value) {
        this.values.set(position, value);
    }

    /**
     *
     * @param position
     * @param value
     */
    public void setValue(int position, BaseCol value) {
        this.values.set(position, value);
    }

    /**
     *
     * @param values
     */
    public void addValues(Number... values) {
        for (int i = 0; i < values.length; i++) {
            this.values.add(values[i]);
        }
    }

    /**
     *
     * @param cols
     */
    public void addValues(BaseCol... cols) {
        for (int i = 0; i < cols.length; i++) {
            this.values.add(cols[i]);
        }
    }

    /**
     * add 'null' to the end of the value list
     */
    public void appendNull() {
        this.values.add(null);
    }

    /**
     * set 'null'
     * e.g. values.addValues(1,2,3,4);
     *      values.setNull(2);
     * result: {1,2,null,4}
     * @param index
     */
    public void setNull(int index) {
        this.values.set(index, null);
    }
}
